<template>
<div class="mapDiv">
  <button @click="openMap">导航到该地点</button>
  <div>详情内容</div>
</div>


</template>

<script>
  export default {
    data() {
      return {
        mapIndetail: {},
      }
    },
    onLoad(option){
      this.mapIndetail = JSON.parse(option.mapdata)
    },
    methods: {
      openMap(){//打开地图导航
        wx.openLocation({//​使用微信内置地图查看位置。
          latitude: this.mapIndetail.latitude,//要去的纬度-地址
          longitude: this.mapIndetail.longitude,//要去的经度-地址
          name: this.mapIndetail.name,
          address: this.mapIndetail.address
        }) 
      },
      wxAlert(txt){
        wx.showToast({
            title: txt,
            icon: "none",
            duration: 2000,
            mask: true
        })
      },
    }
  }
</script>

<style scoped>
.mapDiv{
  background: #ccc;
  width: 100%;
  height: 100%;
  position: absolute;
}
.mapDiv map{
  width: 100%;
  height: 100%;
}
</style>
